﻿@model ListViewModel<CommonSearchValues, IQueryable<SmsSent>>

@{
    ViewBag.Title = "短信查询";
    ViewBag.Back = "/";    
}
<div data-role="navbar">
    <ul>
        <li>@Html.ActionLink("医生留言", "MyQizCommList")</li>
        <li>@Html.ActionLink("系统短信", "SysSmsSessionList", null, new { @class = "ui-btn-active site-nav-active ui-shadow" })</li>
    </ul>
</div>
@if (Model == null || Model.ItemCount == 0)
{
    <p>没有系统短信！</p>
}
else
{
    <ul id="syssmslist" data-role="listview" data-inset="false" data-corners="false">
        @foreach (var qsms in Model.Data)
        {
            <li>
                <h3>@qsms.TextMessage</h3>
                <p><b>发送者：</b>@qsms.SenderName</p>
                <p><b>发送时间：</b>@qsms.SentTime.Value.ToString("yyyy-MM-dd HH:mm:ss")</p>
            </li>
        }
    </ul>
    using (Html.BeginForm("SysSmsSessionList", "Home", FormMethod.Post, new { id = "pageform" }))
    {
        <input type="hidden" id="pageIndex" name="PageIdx" value="@Model.PageIdx" />
        <input type="hidden" id="pageCount" name="PageCount" value="@Model.PageCount" />
        if (Model.PageCount > 1)
        {
        <div class="pagebar">
            @if (Model.PageIdx > 1)
            {
                <a href="javascript:void(0);" class="btn_back" title="上一页" onclick="back();"></a>
            }
            else
            {
                <span class="btn_back"></span>   
            }
            @if (Model.PageIdx < Model.PageCount)
            {
                <a href="javascript:void(0);" class="btn_next" title="下一页" onclick="next();"></a>
            }
            else
            {
                <span class="btn_next"></span>   
            }
        </div>
        }
    }
}

@section Scripts{
    <style type="text/css">
        .ui-content .ui-listview {
            margin:0 0 1em 0;
        }
        .ui-listview > li {
            padding:0.5em;
            margin:0;
        }
            .ui-listview > li h3 {
                word-break:break-all;
                word-wrap:break-word;
                overflow:auto;
                display:inline;
                white-space:normal;                
            }
            .ui-listview > li p {
                font-size:0.8em;
            }
        .pagebar {
            height: 50px;
            line-height: 50px;
            background: #333;
            padding-left: 50%;
            margin-top: -1em;
        }

            .pagebar a, .pagebar span {
                width: 32px;
                height: 32px;
                line-height: 32px;
                display: block;
                float: left;
                margin: 9px 20px 0px 0px;
            }

        a.btn_back {
            background: url(/Content/images/icon-back-32-fff.png) no-repeat;
        }

        span.btn_back {
            background: url(/Content/images/icon-back-32-999.png) no-repeat;
        }

        a.btn_back, span.btn_back {
            margin-left: -52px;
        }

        a.btn_next {
            background: url(/Content/images/icon-next-32-fff.png) no-repeat;
        }

        span.btn_next {
            background: url(/Content/images/icon-next-32-999.png) no-repeat;
        }
    </style>
    <script type="text/javascript">
        function back() {
            var pageIndex = $('#pageIndex').val();
            pageIndex--;
            $('#pageIndex').val(pageIndex);
            $('#pageform').submit();
        };
        function next() {
            var pageIndex = $('#pageIndex').val();
            pageIndex++;
            $('#pageIndex').val(pageIndex);
            $('#pageform').submit();
        };
        //$(function () {
        //    $('#btn_search').click(function () {
        //        if ($('#searchMemoDiv').is(':hidden')) {
        //            $('#searchMemoDiv').show();
        //        } else {
        //            $('#searchMemoDiv').hide();
        //        }
        //    });
        //});
    </script>
}
